#ifndef __LCD_Display_API_H
#define __LCD_Display_API_H

#include "D:/CCS/ti/simplelink_msp432p4_sdk_3_20_00_06/source/ti/devices/msp432p4xx/inc/msp.h"

// ------------------------------------------------------
// 鐢ㄦ埛鑷畾涔夊ご鏂囦欢
#include "LCD_eUSCI_B0_SPI.h"
#include "LCD_Font.h"

// ==========================================================================
// 灞忓箷鏂瑰悜: 鍏�4绉�, 妯悜瀹介珮=320*240; 绾靛悜瀹介珮=240*320
// 0=灞忓箷妯悜鏀剧疆, 鍙充晶寮曞嚭鐢电紗绾�;
// 1=灞忓箷妯悜鏀剧疆, 宸︿晶寮曞嚭鐢电紗绾�; 
// 2=灞忓箷绾靛悜鏀剧疆, 涓嬩晶寮曞嚭鐢电紗绾�;
// 3=灞忓箷绾靛悜鏀剧疆, 涓婁晶寮曞嚭鐢电紗绾�; 
#define Orientation     0       // 0=妯悜瀹介珮=320*240; 1=绾靛悜瀹介珮=240*320

// 閰嶇疆瀛椾綋澶у皬
#define FONT1206   (1)  //瀛椾綋12*6
#define FONT1608   (2)  //瀛椾綋16*8

#define ROW  240        //Y 鏄剧ず鐨勮鏁�
#define COL  320        //X 鏄剧ず鐨勫垪鏁�

#define M_Space_ASCII       (0x20)  //"绌烘牸"鐨凙SCII鐮�

#define M_Vertical_FONT     (16)    //瀛椾綋"鍨傜洿瀹藉害" , 鏄剧ず"琛岃窛"
#define M_Horizontal_FONT   (8)     //瀛椾綋"姘村钩瀹藉害" , 鏄剧ず"瀛楃闂磋窛"

#define MAX_MSG_LEN             256 // generic message length

// ==========================================================================
// 娑叉櫠灞忛鑹�, 鍓嶆櫙鑹�/鑳屾櫙鑹插潎鍙娇鐢�
#define Black           0x0000      /*   0,   0,   0 */
#define Navy            0x000F      /*   0,   0, 128 */
#define DarkGreen       0x03E0      /*   0, 128,   0 */
#define DarkCyan        0x03EF      /*   0, 128, 128 */
#define Maroon          0x7800      /* 128,   0,   0 */
#define Purple          0x780F      /* 128,   0, 128 */
#define Olive           0x7BE0      /* 128, 128,   0 */
#define LightGrey       0xC618      /* 192, 192, 192 */
#define DarkGrey        0x7BEF      /* 128, 128, 128 */
#define Blue            0x001F      /*   0,   0, 255 */
#define Green           0x07E0      /*   0, 255,   0 */
#define Cyan            0x07FF      /*   0, 255, 255 */
#define Red             0xF800      /* 255,   0,   0 */
#define Magenta         0xF81F      /* 255,   0, 255 */
#define Yellow          0xFFE0      /* 255, 255,   0 */
#define White           0xFFFF      /* 255, 255, 255 */
#define Orange          0xFD20      /* 255, 165,   0 */
#define GreenYellow     0xAFE5      /* 173, 255,  47 */

#define BPP             16          // Bits per pixel

// ==========================================================================
// LCD 鍒濆鍖�
void LCD_TFT_Init(void);
// TFT LCD 娓呭睆, 骞跺～鍏呭崟鑹�
void LCD_TFT_Clear(uint16_t color);
// 娑叉櫠妯″潡澶嶄綅
void LCD_TFT_Reset(void);

// 鑾峰彇灞忓箷瀹�/楂�
uint16_t LCD_TFT_Get_Width(void);
uint16_t LCD_TFT_Get_Height(void);
// 璁剧疆灞忓箷鏈�澶у尯鍩�
void LCD_TFT_Set_WindowMax(void);
// 璁剧疆鏄剧ず鏂瑰悜
void LCD_TFT_Set_Orientation(void);
// 璁剧疆绐楀彛鍖哄煙
void LCD_TFT_Set_Window (uint16_t x, uint16_t y, uint16_t w, uint16_t h);
// 鏍煎紡杞崲: 鏁存暟-->瀛楃涓�
uint32_t IntToStr(int32_t uiInteger, char *cStr);

// 鏄剧ず涓�涓瓧绗�( 鎸囧畾鍧愭爣,瀛椾綋澶у皬,棰滆壊)
void LCD_TFT_ShowChar(uint16_t line,uint16_t column,uint8_t AscNum,uint8_t Font,uint16_t pointColor,uint16_t backColor);
// 鏄剧ず瀛楃涓�( 鎸囧畾鍧愭爣,瀛椾綋澶у皬,棰滆壊)
void LCD_TFT_ShowString(uint16_t column,uint16_t line,uint8_t *ArrayPoint,uint8_t Font,uint16_t pointColor,uint16_t backColor);
// 鏄剧ず1涓�24*24鐨勬眽瀛�
void LCD_Show_ChFont2424(uint16_t x,uint16_t y,uint8_t index,uint16_t pointColor,uint16_t backColor);
// 鏄剧ず"寰呮満椤甸潰
void LCD_Show_StandbyPage(void);

// 鏄剧ず鍍忕礌鐐�
void LCD_TFT_pixel(uint16_t x, uint16_t y, uint16_t color);
// 缁樺埗鐩寸嚎 "姘村钩"
void LCD_TFT_hline(int x0, int x1, int y, uint16_t color);
// 缁樺埗鐩寸嚎 "鍨傜洿"
void LCD_TFT_vline(int x, int y0, int y1, uint16_t color);
// 缁樺埗鐩寸嚎 "鏂滅嚎"
void LCD_TFT_line(int x0, int y0, int x1, int y1, uint16_t color);
// 缁樺埗绌哄績鐭╁舰
void LCD_TFT_rect(int x0, int y0, int x1, int y1, uint16_t color);
// 缁樺埗瀹炲績鐭╁舰
void LCD_TFT_fillrect(int x0, int y0, int x1, int y1, uint16_t color);
// 缁樺埗绌哄績鍦�
void LCD_TFT_circle(int x0, int y0, int r, uint16_t color);
// 缁樺埗瀹炲績鍦�
void LCD_TFT_fillcircle(int x, int y, int r, uint16_t color);

#endif

// ==========================================================================
// End of file.
